<?php

class AuthDto
{
    private $username;
    private $password;

    public function __get($_key)
    {
        return $this->$_key;
    }

    // 构造函数，传入数组并赋值
    public function __construct(array $data) {
        foreach ($data as $key => $value) {
            if (property_exists($this, $key)) {
                $this->$key = $value;
            }
        }
    }

}